home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / ps18a12.zip / EXAMPLE.ASM < prev    next >
Assembly Source File  |  1987-03-15  |  2KB  |  60 lines

  1. ; To become familiar with the segment feature you
  2. ; should assemble this file with and without the
  3. ; single object module swicth enabled.
  4. ;
  5. ;   a18  -o example         ;two object module files
  6.                             ;     code.seg
  7.                             ;     foo.seg
  8. ;
  9. ;   a18  example            ;one object module file example.obj
  10.  
  11.          .org 0       ;comment test
  12.          .db 1,2,3,4,5,6,7,8 ;define byte test
  13. lab1:                ;label only test
  14.  
  15.                      ;blank line and comment only test
  16.          .dw 1,32000  ;define word test
  17.          .rs 10       ;reserve storage test
  18.          .dw 1+lab1   ;add test
  19.          .dw lab1-1   ;subtract test
  20.          .dw 1*lab1   ;multiply test
  21.          .dw 'k'      ;character test
  22.          .db 1,d'6,077,o'77,q'77,0x77,h'77,x'aa,x'a,b'1111,b'1 ;radix test
  23.          .db "k"      ;string test--should give no error
  24.          .db "\n\t\b\r\f\\\'\0\145" ;string escape test sequence
  25.          .dw 1 << 15  ;8000
  26.          .dw x'8000 >> 15  ;0001
  27.          .dw ~x'ffff    ;0000
  28.          .dw -1         ;ffff
  29.          .page
  30.          .dw 10 /2      ;5
  31.          .eject
  32.          .dw 32000/2000 ;16
  33.          .dw 27 %5      ;modulus = 2
  34.          .dw x'5555 ~ x'5555 ;ffff
  35.          .dw x'5555 | x'aaaa ;ffff
  36.          .dw x'5555 ^ x'aaaa ;ffff
  37. start:   .dw x'5555 ^ x'5555 ;0000
  38.          .dw x'5555 & x'aaaa ;0000
  39.          .dw x'5555 & x'5555 ;5555
  40.          .dw 32000 + 1  ;large positive
  41.          .dw -32000 + 1 ;small negative
  42.          .dw 5 + - 3 * 2 /3 ;complex expression
  43.          .dw 5 + (-3)*2/3   ;
  44.          .dw lab2
  45.          .dw lab2+1         ;test expression sync
  46.          .code        ;extraneous switch to current segment
  47.          .segment foo
  48.          foo
  49.          .org x'ff
  50.          .db 1,2
  51.          .code
  52.          .db 3,4
  53.          foo
  54. lab2:    .db,5,6
  55.          .set lab3,lab2
  56.          .equ lab3,start
  57. synctest: .DIRECT   +h88 +w132
  58.          .end  start
  59.  
  60.